﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ERP_RORZE_PRODUCT.Product.DAO;

namespace ERP_RORZE_PRODUCT.Product.LINK_VCUONGDATABASE
{
    public partial class ctrlBCKH : DevExpress.XtraEditors.XtraUserControl
    {
        DataTable dt;
        ClsLinkVCuongDAO clsLVDAO = new ClsLinkVCuongDAO();

        public ctrlBCKH()
        {
            InitializeComponent();
        }

        private void ctrlBCKH_Load(object sender, EventArgs e)
        {
            cbStore.Items.Add("PWTSDelete");//0
            cbStore.Items.Add("PWTSUpdate");//1
            cbStore.Items.Add("QBCBieuThoigianchaymayNgay VN");//2
            cbStore.Items.Add("QBCBieuthoigianchaymayNgay JP");//3
            cbStore.Items.Add("QTGCMCross_CrosstabVN");//4
            cbStore.Items.Add("QTGCMCross_CrosstabJP");//5
            cbStore.Items.Add("QBChangNG");//6
            cbStore.Items.Add("Qketquagiaconghangloat");//7
            cbStore.Items.Add("Qketquachaythu");//8
        }

        private void cbStore_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbStore.SelectedIndex.ToString() == "0")
            {
                dt = clsLVDAO.PWTSDelete();
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "1")
            {
                dt = clsLVDAO.PWTSUpdate(dateDateFrom.Value);
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "2")
            {
                dt = clsLVDAO.QBCBieuThoigianchaymayNgayVN();
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "3")
            {
                dt = clsLVDAO.QBCBieuthoigianchaymayNgayJP();
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "4")
            {
                dt = clsLVDAO.QTGCMCross_CrosstabVN();
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "5")
            {
                dt = clsLVDAO.QTGCMCross_CrosstabJP();
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "6")
            {
                dt = clsLVDAO.QBChangNG(dateDateFrom.Value);
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "7")
            {
                dt = clsLVDAO.Qketquagiaconghangloat(dateDateFrom.Value);
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
            else if (cbStore.SelectedIndex.ToString() == "8")
            {
                dt = clsLVDAO.Qketquachaythu(dateDateFrom.Value);
                gridControl1.DataSource = dt;
                gridView1.PopulateColumns();
                gridView1.BestFitColumns();
            }
        }

    }
}
